<!DOCTYPE html>
<html>
<head>
  <title>商品推荐banner表</title>
  <#include "/header.html">
  <link rel="stylesheet" href="${request.contextPath}/statics/plugins/iview/css/iview.css">
  <script src="${request.contextPath}/statics/plugins/iview/iview.min.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
  <div v-show="showList">
    <div class="grid-btn">
        <#if shiro.hasPermission("goods:goodsrecbanner:save")>
        <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
        </#if>
        <#if shiro.hasPermission("goods:goodsrecbanner:update")>
        <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
      </#if>
      <#if shiro.hasPermission("goods:goodsrecbanner:delete")>
      <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
    </#if>
    </div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>


<div v-show="!showList" class="panel panel-default">
  <div class="panel-heading" style="margin-bottom: 30px">{{title}}</div>
  <i-form ref="formValidate" :model="goodsRecBanner" :rules="ruleValidate" :label-width="80">
    <Form-item label="商品Tab" prop="tabId">
      <i-select style="width: 200px" v-model="goodsRecBanner.tabId" filterable label-in-value>
        <i-option v-for="item in goodsTabs" :value="item.code"
                  :key="item.id">{{item.value}}
        </i-option>
      </i-select>
    </Form-item>
    <Row>
      <i-col span="16">
        <Form-item label="商品图片" prop="picUrl">
          <i-input v-model="goodsRecBanner.picUrl" placeholder="商品图片" style="width: 600px;" readonly/>
        </Form-item>
      </i-col>
      <i-col span="3">
        <Form-item :label-width="1">
          <Upload style="width: 300px;" :action="baseURL+'/sys/oss/upload'" :format="['jpg','jpeg','png']"
                  max-size="2048"
                  :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
                  :show-upload-list="false"
                  :on-exceeded-size="handleMaxSize">
            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
          </Upload>
        </Form-item>
      </i-col>
      <i-col span="3">
        <Form-item :label-width="1">
          <i-button icon="eye" @click="eyeImageListPicUrl(goodsRecBanner.picUrl)">预览图片</i-button>
        </Form-item>
      </i-col>
    </Row>
    <Form-item label="描述" prop="desc">
      <i-input v-model="goodsRecBanner.desc" placeholder="描述" style="width: 600px;"/>
    </Form-item>
    <Form-item label="跳转链接" prop="url">
      <i-input v-model="goodsRecBanner.url" placeholder="跳转链接" style="width: 600px;"/>
    </Form-item>
    <Form-item label="类型" prop="type">
      <Radio-group v-model="goodsRecBanner.type">
        <Radio label="1">
          <span>商品id</span>
        </Radio>
        <Radio label="2">
          <span>url</span>
        </Radio>
      </Radio-group>
    </Form-item>
    <Form-item label="排序" prop="sortNo">
      <Input-number :min="0" :step="1" v-model="goodsRecBanner.sortNo" placeholder="排序"
                    style="width: 188px;"/>
    </Form-item>

    <Form-item>
      <i-button type="primary" @click="handleSubmit('formValidate')" style="background-color: #286090;">确定</i-button>
      <i-button type="warning" @click="reload" style="margin-left: 8px;background-color: #ec971f;"/>返回</i-button>
    </Form-item>
  </i-form>
</div>
</div>

<script src="${request.contextPath}/statics/js/modules/goods/goodsrecbanner.js?_${.now?long}"></script>
</body>
</html>